Skip to content

fix(k9): correct security levels + deploy pedigree (Validate K9 contracts)#66

Merged
hyperpolymath merged 3 commits into
mainfrom
claude/gallant-faraday-LSAGJ
Jun 20, 2026
Merged

fix(k9): correct security levels + deploy pedigree (Validate K9 contracts)#66
hyperpolymath merged 3 commits into
mainfrom
claude/gallant-faraday-LSAGJ

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Clears the three pre-existing Validate K9 contracts errors (separate from the now-merged hypatia fix; flagged on #64/#65 as unrelated).

The two simple ones — invalid security level:

  • coordination.k9 and session/custom-checks.k9 set security_level = "data-only", which isn't a valid K9 level (kennel|yard|hunt). Both declare leash = "Kennel" and "no network/write/subprocess access" in their headers, so the correct value is "kennel".

The template — container/deploy.k9.ncl:
The k9 validator scans for a word-boundary pedigree = { block. This template's block was let component_pedigree = { (the component_ prefix means it doesn't match), so the validator fell back to line 156's pedigree = component_pedigree — a reference with no fields — and reported name/version/security_level all missing. Fix:

  • renamed the binding component_pedigreepedigree (now the real block matches);
  • added the top-level security_level = "hunt" the header comment already claimed was there (it's a Hunt-level component);
  • updated the export reference accordingly.

Validation: this PR's own Validate K9 contracts check is the empirical test — if it goes green, all three are cleared. The deploy.k9.ncl fix is based on the validator's apparent word-boundary matching; if the check shows a different residual error I'll adjust.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PWMMxryCcPrAjJ8tuGvygG


Generated by Claude Code

…tracts passes

Three K9 contract errors flagged by k9-validate: coordination.k9 and session/custom-checks.k9 set security_level "data-only", which is not a valid level (must be kennel|yard|hunt) — set to "kennel" to match their leash=Kennel and 'no network/write/subprocess' intent. container/deploy.k9.ncl: the validator scans for a word-boundary 'pedigree = {' block, but this template used 'let component_pedigree = {' (unmatched), so it fell back to the 'pedigree = component_pedigree' reference and reported name/version/security_level missing — renamed the binding to 'pedigree', added the top-level security_level="hunt" the header comment already promised, and updated the export reference.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PWMMxryCcPrAjJ8tuGvygG
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 22 issues detected

Severity Count
🔴 Critical 1
🟠 High 15
🟡 Medium 6

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Issue in scorecard-enforcer.yml",
    "type": "scorecard_publish_with_run_step",
    "file": "scorecard-enforcer.yml",
    "action": "split_scorecard_publish_job",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in instant-sync.yml",
    "type": "secret_action_without_presence_gate",
    "file": "instant-sync.yml",
    "action": "peter-evans/repository-dispatch",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in rsr-antipattern.yml",
    "type": "unanchored_heading_regex",
    "file": "rsr-antipattern.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Download-and-execute pattern (curl|wget pipe to shell) -- verify integrity before execution (3 occurrences, CWE-494)",
    "type": "shell_download_then_run",
    "file": "/home/runner/work/nextgen-typing/nextgen-typing/setup.sh",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "line": 24,
    "reason": "Secret found: Generic API key",
    "type": "secret_detected",
    "file": "/home/runner/work/nextgen-typing/nextgen-typing/.envrc",
    "action": "revoke_rotate_and_purge",
    "rule_module": "security_errors",
    "severity": "critical"
  },
  {
    "reason": "Nominal-only SAST in nextgen-typing: codeql.yml language matrix contains no language present in the repo and lacks `actions`, so CodeQL records zero results on every commit. Remediation: set the CodeQL matrix to `language: actions`.",
    "type": "StaticAnalysis",
    "file": "/home/runner/work/nextgen-typing/nextgen-typing",
    "action": "auto_fix",
    "rule_module": "scorecard",
    "severity": "medium",
    "remediation": "Add CodeQL or equivalent SAST workflow.",
    "scorecard_check": "SAST"
  },
  {
    "reason": "Repository has 6 non-main remote branch(es). Policy: single main branch only.",
    "type": "GS007",
    "file": ".",
    "action": "delete_remote_branches",
    "rule_module": "git_state",
    "severity": "medium"
  },
  {
    "reason": "Code scanning (Scorecard): FuzzingID -- Fuzzing -- 7 day(s) old",
    "type": "CSA001",
    "file": "no file associated with this alert",
    "action": "review",
    "rule_module": "code_scanning_alerts",
    "severity": "medium"
  },
  {
    "reason": "Code scanning (Scorecard): MaintainedID -- Maintained -- 7 day(s) old",
    "type": "CSA001",
    "file": "no file associated with this alert",
    "action": "update",
    "rule_module": "code_scanning_alerts",
    "severity": "high"
  },
  {
    "reason": "Code scanning (Scorecard): CodeReviewID -- Code-Review -- 7 day(s) old",
    "type": "CSA001",
    "file": "no file associated with this alert",
    "action": "update",
    "rule_module": "code_scanning_alerts",
    "severity": "high"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

…n read

k9-validate scans for a line-anchored literal 'pedigree = {' field and cannot follow the 'let component_pedigree' indirection (it was matching the bare 'pedigree = component_pedigree' reference and reporting all fields missing). Inline a visible pedigree block with schema_version/component_type/security_level/metadata.name, merged (& component_pedigree) with the full L1-L5 pedigree so nothing is lost. Mirrors the passing template-hunt.k9.ncl shape.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PWMMxryCcPrAjJ8tuGvygG
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 22 issues detected

Severity Count
🔴 Critical 1
🟠 High 15
🟡 Medium 6

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Issue in scorecard-enforcer.yml",
    "type": "scorecard_publish_with_run_step",
    "file": "scorecard-enforcer.yml",
    "action": "split_scorecard_publish_job",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in instant-sync.yml",
    "type": "secret_action_without_presence_gate",
    "file": "instant-sync.yml",
    "action": "peter-evans/repository-dispatch",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in rsr-antipattern.yml",
    "type": "unanchored_heading_regex",
    "file": "rsr-antipattern.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Download-and-execute pattern (curl|wget pipe to shell) -- verify integrity before execution (3 occurrences, CWE-494)",
    "type": "shell_download_then_run",
    "file": "/home/runner/work/nextgen-typing/nextgen-typing/setup.sh",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "line": 24,
    "reason": "Secret found: Generic API key",
    "type": "secret_detected",
    "file": "/home/runner/work/nextgen-typing/nextgen-typing/.envrc",
    "action": "revoke_rotate_and_purge",
    "rule_module": "security_errors",
    "severity": "critical"
  },
  {
    "reason": "Nominal-only SAST in nextgen-typing: codeql.yml language matrix contains no language present in the repo and lacks `actions`, so CodeQL records zero results on every commit. Remediation: set the CodeQL matrix to `language: actions`.",
    "type": "StaticAnalysis",
    "file": "/home/runner/work/nextgen-typing/nextgen-typing",
    "action": "auto_fix",
    "rule_module": "scorecard",
    "severity": "medium",
    "remediation": "Add CodeQL or equivalent SAST workflow.",
    "scorecard_check": "SAST"
  },
  {
    "reason": "Repository has 6 non-main remote branch(es). Policy: single main branch only.",
    "type": "GS007",
    "file": ".",
    "action": "delete_remote_branches",
    "rule_module": "git_state",
    "severity": "medium"
  },
  {
    "reason": "Code scanning (Scorecard): FuzzingID -- Fuzzing -- 7 day(s) old",
    "type": "CSA001",
    "file": "no file associated with this alert",
    "action": "review",
    "rule_module": "code_scanning_alerts",
    "severity": "medium"
  },
  {
    "reason": "Code scanning (Scorecard): MaintainedID -- Maintained -- 7 day(s) old",
    "type": "CSA001",
    "file": "no file associated with this alert",
    "action": "update",
    "rule_module": "code_scanning_alerts",
    "severity": "high"
  },
  {
    "reason": "Code scanning (Scorecard): CodeReviewID -- Code-Review -- 7 day(s) old",
    "type": "CSA001",
    "file": "no file associated with this alert",
    "action": "update",
    "rule_module": "code_scanning_alerts",
    "severity": "high"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath hyperpolymath marked this pull request as ready for review June 20, 2026 18:05
@hyperpolymath hyperpolymath merged commit 190e4ae into main Jun 20, 2026
@hyperpolymath hyperpolymath deleted the claude/gallant-faraday-LSAGJ branch June 20, 2026 18:06
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 22 issues detected

Severity Count
🔴 Critical 1
🟠 High 15
🟡 Medium 6

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Issue in scorecard-enforcer.yml",
    "type": "scorecard_publish_with_run_step",
    "file": "scorecard-enforcer.yml",
    "action": "split_scorecard_publish_job",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in instant-sync.yml",
    "type": "secret_action_without_presence_gate",
    "file": "instant-sync.yml",
    "action": "peter-evans/repository-dispatch",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in rsr-antipattern.yml",
    "type": "unanchored_heading_regex",
    "file": "rsr-antipattern.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Download-and-execute pattern (curl|wget pipe to shell) -- verify integrity before execution (3 occurrences, CWE-494)",
    "type": "shell_download_then_run",
    "file": "/home/runner/work/nextgen-typing/nextgen-typing/setup.sh",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "line": 24,
    "reason": "Secret found: Generic API key",
    "type": "secret_detected",
    "file": "/home/runner/work/nextgen-typing/nextgen-typing/.envrc",
    "action": "revoke_rotate_and_purge",
    "rule_module": "security_errors",
    "severity": "critical"
  },
  {
    "reason": "Nominal-only SAST in nextgen-typing: codeql.yml language matrix contains no language present in the repo and lacks `actions`, so CodeQL records zero results on every commit. Remediation: set the CodeQL matrix to `language: actions`.",
    "type": "StaticAnalysis",
    "file": "/home/runner/work/nextgen-typing/nextgen-typing",
    "action": "auto_fix",
    "rule_module": "scorecard",
    "severity": "medium",
    "remediation": "Add CodeQL or equivalent SAST workflow.",
    "scorecard_check": "SAST"
  },
  {
    "reason": "Repository has 4 non-main remote branch(es). Policy: single main branch only.",
    "type": "GS007",
    "file": ".",
    "action": "delete_remote_branches",
    "rule_module": "git_state",
    "severity": "medium"
  },
  {
    "reason": "Code scanning (Scorecard): FuzzingID -- Fuzzing -- 7 day(s) old",
    "type": "CSA001",
    "file": "no file associated with this alert",
    "action": "review",
    "rule_module": "code_scanning_alerts",
    "severity": "medium"
  },
  {
    "reason": "Code scanning (Scorecard): MaintainedID -- Maintained -- 7 day(s) old",
    "type": "CSA001",
    "file": "no file associated with this alert",
    "action": "update",
    "rule_module": "code_scanning_alerts",
    "severity": "high"
  },
  {
    "reason": "Code scanning (Scorecard): CodeReviewID -- Code-Review -- 7 day(s) old",
    "type": "CSA001",
    "file": "no file associated with this alert",
    "action": "update",
    "rule_module": "code_scanning_alerts",
    "severity": "high"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants